var ClubQuickJoinWindow = Window.extend({
    _ccsFileName: res.ClubQuickJoinWindow_json,
    _callBack: null,
    _clubId: null,
    _floor: null,
    initWindow: function (clubId, floor) {
        this._clubId = clubId;
        this._floor = floor;
        var wanfasInfo = ClubDataManager.getClubFloorWanfaInfo(clubId, floor);
        var wanfaInfo = ClubDataManager.analysisWanFaInfo(JSON.parse(wanfasInfo.options));
        var playerMap = wanfaInfo.playerMap; //当前玩法所支持的玩家人数
        var keys = _.keys(playerMap);
        var btnX = {
            2: [-175, 165],
            3: [-275, -5, 265],
        };
        var index = 0;
        for (var i = 2; i <= 9; i++) {
            if (this._nodeList['btn_qJoin' + i] == undefined) continue;
            var temp = (keys.indexOf(i + '') >= 0);
            this._nodeList['btn_qJoin' + i].setVisible(temp);
            if (temp) {
                this._nodeList['btn_qJoin' + i].x = btnX[keys.length][index];
                index++;
            }
        }
    },
    _initClickListeners: function () {
        for (var i = 2; i <= 9; i++) {
            if (this._nodeList['btn_qJoin' + i] == undefined) continue;
            this._clickListeners['btn_qJoin' + i] = '_clickQuickJoin';
        }
    },
    _clickQuickJoin: function (target) {
        var str = target.getName();
        var index = str.charAt(str.length - 1);
        clubMsgManager.requestQuickJoinRoom(this._clubId, this._floor, index);
        this.close();
    },
});